<#include "../../page.ftl" />
<table class="table table-datatable table-gray">
    <input type="hidden" id="selectTypeId" name="selectTypeId"/>
    <thead>
    <tr>
        <th>代码类别ID</th>
        <th>代码类别名称</th>
    </tr>
    </thead>
    <tbody>
    <#if codeTypesTable.rows??>
        <#list codeTypesTable.rows as codeType>
        <tr onclick="selectArow(this);">
            <td id="typeId">${codeType.name()}</td>
            <td>${codeType.getDesc()}</td>
        </tr>
        </#list>
    </#if>
    </tbody>
</table>
<#if codeTypesTable??>
    <@page table=codeTypesTable formId="search_codeType_table"/>
</#if>
<script>
    $(function () {
        $("table tbody tr").click(function () {
            $("table tbody tr").removeClass("active");
            $(this).addClass("active");
        });
    });


    function selectArow(sObject) {
        var codeTypeId = $(sObject).children("td:eq(0)").text();
        if (codeTypeId != "") {
            $("#selectTypeId").val(codeTypeId);
            var codeTypeIds = new Array();
            codeTypeIds.push(codeTypeId);
            refreshTableInfo(codeTypeIds);
        }
    }

</script>